<template>
  <div>
    {{ displayed }}
  </div>
</template>

<script setup lang="ts">
const props = defineProps<{
  value: Promise<any>
  prop: string
}>()

const waited = ref(null as any)
const displayed = computed(() => {
  if (!waited.value) {
    return null
  }
  return waited.value[props.prop]
})

onMounted(async () => {
  waited.value = await props.value
})
</script>